package com.chris.libs.example.pages.tabs.main.widget;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import javax.inject.Inject;

/**
 * 响应式数据持有者
 */
public class WidgetViewModel extends ViewModel {

    private MutableLiveData<String> mText;

    @Inject
    public WidgetViewModel() {
        mText = new MutableLiveData<>();
        mText.setValue("控件");
    }

    public LiveData<String> getText() {
        return mText;
    }

    public void setText(String text) {
        this.mText.setValue(text);
    }
}